#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

char s[2009] = {0};

void runCase()
{
	scanf("%s", s);
	int len = strlen(s);
	int k = 0;
	for ( int i = 0; i < len; i++ ) {
		if ( s[i] >= '0' && s[i] <= '9' ) {
			continue;
		}
		s[k] = s[i];
		k ++;
	}
	s[k] = 0;
	sort(s, s+k);
	printf("%s\n", s);
}

int main()
{
	freopen("password.in", "r", stdin);
	freopen("password.out", "w", stdout);
	int t = 0;
	scanf("%d", &t);
	for ( int i = 0; i < t; i++ ) {
		runCase();
	}
	return 0;
}

